#include<iostream>
#include<vector>
using namespace std;

int getFirstUnFormedNum(vector<int> arr, int len)
{
	vector<int> tmp;

}
int main()
{
	int n = 0;
	cin >> n;
	vector<int> arr(n);
	for (int i = 0; i < arr.size(); ++i)
	{
		cin >> arr[i];
	}
	int len = arr.size();
	int result = getFirstUnFormedNum(arr, len);
	cout << result << endl;
	return 0;
}


int NotRealMoney(int n)
{
	int cnt = 0;
	while (n >= 2)
	{
		if (n % 3 == 1)
			n = n / 3 + 1;
		else
			n = n / 3;
		cnt++;
	}
	return cnt;
}

int main()
{
	int n = 0;
	while (cin >> n)
	{
		if (n == 0)break;
		int result = NotRealMoney(n);
		cout << result << endl;
	}
	return 0;
}